package com.crr.mall.ware.dao;

import com.crr.mall.ware.entity.PurchaseDetailEntity;
import com.crr.mall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 * 
 * @author chenrenren
 * @email chenrenren@gmail.com
 * @date 2024-11-22 20:37:24
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {
    /**
     * 根据条件查询wareSku信息
     * @param map
     * @return
     */
    List<Map> queryByCondition(Map map);

    /**
     * 修改
     * @param purchaseDetail
     * @return
     */
    int addStock(PurchaseDetailEntity purchaseDetail);

    /**
     * 新增
     * @param purchaseDetail
     * @return
     */
    int saveStock(@Param("skuName") String skuName, @Param("purchaseDetail") PurchaseDetailEntity purchaseDetail);
    /**
     * 根据条件查询WareSkuEntity
     * @param purchaseDetail
     * @return
     */
    WareSkuEntity getByskuIdAndwareId(PurchaseDetailEntity purchaseDetail);

    /**
     * 根据skuIds查询库存
     * @param skuId
     * @return
     */
    Long queryStock(@Param("skuId")Long skuId);


}
